package com.skywolf.chem.article.mapper;

import com.skywolf.chem.article.entity.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 帖子 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2020-06-09
 */
@Mapper
public interface ArticleMapper extends BaseMapper<Article> {

    List<Article> getArticlePageList(@Param("startNum") Long startNum, @Param("endNum") Long endNum,
                                     @Param("colId") Long colId,@Param("titleDesc")String titleDesc,@Param("artStatus")Integer artStatus,
                                     @Param("artType") Integer artType,@Param("startTime")String startTime,@Param("endTime")String endTime);

    Integer getArticlePageCount(@Param("colId") Long colId,@Param("titleDesc")String titleDesc,@Param("artStatus")Integer artStatus,
                                @Param("artType") Integer artType,@Param("startTime")String startTime,@Param("endTime")String endTime);


    List<Article> getArticlePageListManager(@Param("startNum") Long startNum, @Param("endNum") Long endNum,
                                     @Param("colId") Long colId,@Param("titleDesc")String titleDesc,@Param("artStatus")Integer artStatus,
                                     @Param("artType") Integer artType,@Param("startTime")String startTime,@Param("endTime")String endTime,@Param("pcfirst")Integer pcfirst);

    Integer getArticlePageCountManager(@Param("colId") Long colId,@Param("titleDesc")String titleDesc,@Param("artStatus")Integer artStatus,
                                @Param("artType") Integer artType,@Param("startTime")String startTime,@Param("endTime")String endTime,@Param("pcfirst")Integer pcfirst);

    List<Article> getArticleByColumnId(@Param("colId") Long colId,@Param("articleId")Long articleId);

    List<Article> getRecommendnews(@Param("articleId")Long articleId);

    int updateArticle(Article article);

    List<Long> getRecommend();

    List<Article> getRecommendList(@Param("articleIds") List<Long> articleIds);

    int updateArticleBug(@Param("title")String title,@Param("id")Long id);

}
